package com.andy.qi.domain;

import java.io.Serializable;

import javax.persistence.Embeddable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
@Table(name = "t_games_archive")
public class GameArchive {

    @EmbeddedId
    private GameArchivePK id;
    private String base_info;
    private int create_time;
    private String snapshots;
    private String action_records;
    private String result;
    
    
    public GameArchivePK getId() {
        return id;
    }
    public void setId(GameArchivePK id) {
        this.id = id;
    }
    public String getBase_info() {
        return base_info;
    }
    public void setBase_info(String base_info) {
        this.base_info = base_info;
    }
    public int getCreate_time() {
        return create_time;
    }
    public void setCreate_time(int create_time) {
        this.create_time = create_time;
    }
    public String getSnapshots() {
        return snapshots;
    }
    public void setSnapshots(String snapshots) {
        this.snapshots = snapshots;
    }
    public String getAction_records() {
        return action_records;
    }
    public void setAction_records(String action_records) {
        this.action_records = action_records;
    }
    public String getResult() {
        return result;
    }
    public void setResult(String result) {
        this.result = result;
    }
    
    @Embeddable
    public static class GameArchivePK implements Serializable {
        /**
         * 
         */
        private static final long serialVersionUID = 1L;
        
        private String roomUuid;
        private int gameIndex;
        public String getRoomUuid() {
            return roomUuid;
        }
        public void setRoomUuid(String roomUuid) {
            this.roomUuid = roomUuid;
        }
        public int getGameIndex() {
            return gameIndex;
        }
        public void setGameIndex(int gameIndex) {
            this.gameIndex = gameIndex;
        }
        @Override
        public int hashCode() {
            final int prime = 31;
            int result = 1;
            result = prime * result + gameIndex;
            result = prime * result + ((roomUuid == null) ? 0 : roomUuid.hashCode());
            return result;
        }
        @Override
        public boolean equals(Object obj) {
            if (this == obj)
                return true;
            if (obj == null)
                return false;
            if (getClass() != obj.getClass())
                return false;
            GameArchivePK other = (GameArchivePK) obj;
            if (gameIndex != other.gameIndex)
                return false;
            if (roomUuid == null) {
                if (other.roomUuid != null)
                    return false;
            } else if (!roomUuid.equals(other.roomUuid))
                return false;
            return true;
        }
    }
}
